<!doctype html>
<html>
<head>
    <meta charset=utf-8>
    <title></title>
    <meta name="robots" content="noindex,nofollow">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="<?=Web_Path?>packs/layui/css/layui.css">
    <link rel="stylesheet" href="<?=Web_Path?>packs/admin/css/font.css">
    <link rel="stylesheet" href="<?=Web_Path?>packs/admin/css/style.css">
    <script src="<?=Web_Path?>packs/js/jquery.min.js"></script>
    <script src="<?=Web_Path?>packs/layui/layui.js"></script>
</head>
<body id="links_edit">
    <form class="layui-form layui-form-pane" action="<?=site_url('links/save')?>" method="post">
        <div class="layui-form-item">
            <label class="layui-form-label"><?=L('tpl_e_01')?></label>
            <div class="layui-input-block">
                <input type="text" name="name" value="<?=$name?>" placeholder="<?=L('tpl_e_02')?>" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><?=L('tpl_e_03')?></label>
            <div class="layui-input-block">
                <input type="text" name="url" value="<?=$url?>" placeholder="<?=L('tpl_e_04')?>" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><?=L('tpl_e_05')?></label>
            <div class="layui-input-block" id="cid">
                <input type="radio" name="cid" value="1" title="<?=L('tpl_e_06')?>" <?php if($cid==1) echo ' checked="checked"';?>>
                <input type="radio" name="cid" value="2" title="<?=L('tpl_e_07')?>" <?php if($cid==2) echo ' checked="checked"';?>>
            </div>
        </div>
        <div id="logo" class="layui-form-item" <?php if($cid==1) echo ' style="display:none"';?>>
            <label class="layui-form-label">LOGO</label>
            <div class="layui-input-inline" >
                <input id="pic" type="text" name="pic" value="<?=$pic?>" class="layui-input">
            </div>
            <div class="layui-input-inline" style="width: auto;">
            <?php 
                if(preg_match("/(iPhone|iPad|iPod|Android)/i", strtoupper($_SERVER['HTTP_USER_AGENT']))){
                    echo '<button type="button" class="layui-btn layui-btn-primary" id="pics"><i class="layui-icon colorb">&#xe608;</i>上传图片</button>';
                }else{
                    echo '<a href="javascript:cscms.get_open(\''.site_url('upload/up').'?dir=links\',\''.L('tpl_e_08').'\',\'500px\',\'360px\')" class="layui-btn layui-btn-primary"><i class="layui-icon" style="color:green">&#xe608;</i>'.L('tpl_e_08').'</a>';
                }
            ?>
                
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><?=L('tpl_e_9')?></label>
            <div class="layui-input-block">
                <input type="radio" name="sid" value="1"  title="<?=L('tpl_e_10')?>" <?php if($sid==1) echo ' checked="checked"';?>>
                <input type="radio" name="sid" value="0" title="<?=L('tpl_e_11')?>" <?php if($sid==0) echo ' checked="checked"';?>>
            </div>
        </div>
        <input name="id" type="hidden" value="<?=$id?>">
        <div class="layui-form-item">
            <div class="layui-input-block layui-input-center">
                <button class="layui-btn" lay-submit lay-filter="setting"><?=L('tpl_e_12')?></button>
                <button type="reset" class="layui-btn layui-btn-primary"><?=L('tpl_e_13')?></button>
            </div>
        </div>
    </form>
<script src="<?=Web_Path?>packs/admin/js/cscms.js"></script>
<script>
cscms.init();
$(document).ready(function() {
    $('#cid').click(function(event) {
        var cid = $('input[name="cid"]:checked').val();
        if(cid==1){
            $('#logo').hide();
        }else{
            $('#logo').show();
        }
    });
});
cscms.mode("cscms.getUpload('<?=Web_Path.SELF?>/upload/up_save_json?dir=links')");
</script>
</body>
</html>
